package Month07.day24.stu;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("aaa");
        list.add("bbb");
        list.add("bbb");
        System.out.println("输入");
        Scanner scanner = new Scanner(System.in);
        String sc = scanner.next();
        Iterator<String> iterator = list.iterator();
        while (iterator.hasNext()) {
            String s = iterator.next();
            if (s.contains(sc)) {
                System.out.println("存在这个元素");
                break;
            } else {
                System.out.println("不存在");
                break;
            }
        }
    }
}
